package com.xdcplus.web.common.enums.wo;

public enum WoReturnMaterialReturnMaterialTypeEnum {
    // 数据操作错误定义
    RETURN_MATERIAL_TYPE_WO("01", "工单退料"),
    RETURN_MATERIAL_TYPE_UNPACK("02", "分片拆包退料"),
    RETURN_MATERIAL_TYPE_LOSS("03", "loss不良退料"),
    RETURN_MATERIAL_TYPE_TAKE("04", "取片登记退料"),
    ;

    private String code;

    private String msg;

    WoReturnMaterialReturnMaterialTypeEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    /**
     * 根据code获取描述
     * @param code
     * @return
     */
    public static String getMsgByCode(String code) {
        for (WoReturnMaterialReturnMaterialTypeEnum ele : values()) {
            if(ele.getCode().equals(code)) {return ele.getMsg();}
        }
        return null;
    }
}
